//
//  YBLoginCreateZjcViewController+LayoutConstraints.m
//  Nectar
//
//  Created by famer on 2023/11/7.
//  Copyright © 2023 asance. All rights reserved.
//

#import "YBLoginCreateZjcViewController+LayoutConstraints.h"
#import "YBNextStepView.h"
#import "YBNavigationBar.h"

@implementation YBLoginCreateZjcViewController (LayoutConstraints)

- (void)setLayoutConstraints{
    CGFloat width = self.view.frame.size.width;
    CGFloat leftMargin = [NSNumber adaptToWidth:16];
    
//    self.navigationBar.frame = CGRectMake(0,  [UIView statusBarHeight], width, 64);
    
    CGFloat createWalletLabelWidth = width-leftMargin*2;
    self.createWalletLabel.frame  = CGRectMake(leftMargin, 90, createWalletLabelWidth, [self.createWalletLabel textBoundingSizeWithMaxSize:CGSizeMake(createWalletLabelWidth, 500)].height);
    
    self.backupWalletImageView.frame = CGRectMake(leftMargin, self.createWalletLabel.bottom+30, 30, 30);
    
    CGFloat backupWalletLabelWidth = width-self.backupWalletImageView.right-10;
    self.backupWalletLabel.frame = CGRectMake(self.backupWalletImageView.right+10, self.createWalletLabel.bottom+30, backupWalletLabelWidth, 30);
    
    
    CGFloat itemLabelWith = (width-leftMargin*2)/3.0;
    CGFloat itemLabelHeight = 66;
    
    //record,pen,sleep,leave,almost,matrix,lens,load,sound,rally,boil,crunch
    self.zjcContentView.frame = CGRectMake(leftMargin, self.backupWalletLabel.bottom+20, width-leftMargin*2, itemLabelHeight*4);
    for(int i=0;i<self.zjcItemLabelArray.count;i++){
        UILabel *label = self.zjcItemLabelArray[i];
        
        int div3 = (i)/3;
        int mod3 = (i)%3;
        CGFloat itemLeft = itemLabelWith*mod3;
        CGFloat itemTop = itemLabelHeight*div3;
        label.frame = CGRectMake(itemLeft, itemTop, itemLabelWith, itemLabelHeight);
        
        UILabel *indexLabel = self.zjcIndexLabelArray[i];
        indexLabel.frame = CGRectMake(itemLabelWith-20, 6, 20, 10);
    }
    
    self.verLineView1.frame = CGRectMake(itemLabelWith, 0, 1, self.zjcContentView.height);
    self.verLineView2.frame = CGRectMake(itemLabelWith*2, 0, 1, self.zjcContentView.height);

    self.horLineView1.frame = CGRectMake(0, itemLabelHeight, self.zjcContentView.width, 1);
    self.horLineView2.frame = CGRectMake(0, itemLabelHeight*2, self.zjcContentView.width, 1);
    self.horLineView3.frame = CGRectMake(0, itemLabelHeight*3, self.zjcContentView.width, 1);

    self.nextStepView.frame = CGRectMake(leftMargin, self.zjcContentView.bottom+30, self.zjcContentView.width, 50);
    
    CGFloat dotLabelWidth = width-leftMargin*2-12;
    self.dotView1.frame = CGRectMake(leftMargin, self.nextStepView.bottom+34, 4, 4 );
    self.dotLabel1.frame = CGRectMake(self.dotView1.right+12, self.nextStepView.bottom+30, dotLabelWidth, [self.dotLabel1 textBoundingSizeWithMaxSize:CGSizeMake(dotLabelWidth, 500)].height );

    self.dotView2.frame = CGRectMake(leftMargin, self.dotLabel1.bottom+14, 4, 4 );
    self.dotLabel2.frame = CGRectMake(self.dotView2.right+12, self.dotLabel1.bottom+10, dotLabelWidth, [self.dotLabel2 textBoundingSizeWithMaxSize:CGSizeMake(dotLabelWidth, 500)].height);

}


@end
